package legumes.client.ui.basket.slate;

import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter;
import com.google.gwt.user.client.ui.Widget;

public class SlatePanel extends SimplePanel {

	private FlexTable flexTableFullBasketSlate;
	
	public SlatePanel(Widget slateContent_){
		super();
		
		SimplePanel sp = new SimplePanel();
		sp.addStyleName("slateMenuMiddleCenter");
		sp.add(slateContent_);

		flexTableFullBasketSlate = new FlexTable();
		flexTableFullBasketSlate.setWidth("250px");
		flexTableFullBasketSlate.setCellPadding(0);
		flexTableFullBasketSlate.setCellSpacing(0);
		flexTableFullBasketSlate.setBorderWidth(0);
		
		flexTableFullBasketSlate.setHTML(0, 0, "<div class=\"slateMenuTopLeft\"></div>");
		flexTableFullBasketSlate.setHTML(0, 1, "<div class=\"slateMenuTopCenter\"></div>");
		flexTableFullBasketSlate.setHTML(0, 2, "<div class=\"slateMenuTopRight\"></div>");
		
		flexTableFullBasketSlate.setHTML(1, 0, "<div class=\"slateMenuMiddleLeft\"></div>");
		flexTableFullBasketSlate.setHTML(1, 2, "<div class=\"slateMenuMiddleRight\"></div>");
		
		flexTableFullBasketSlate.setHTML(2, 0, "<div class=\"slateMenuBottomLeft\"></div>");
		flexTableFullBasketSlate.setHTML(2, 1, "<div class=\"slateMenuBottomCenter\"></div>");
		flexTableFullBasketSlate.setHTML(2, 2, "<div class=\"slateMenuBottomRight\"></div>");
		
		
		FlexCellFormatter fcf = (FlexCellFormatter) flexTableFullBasketSlate.getCellFormatter();
		fcf.addStyleName(1, 0, "slateMenuMiddleLeft");
		fcf.addStyleName(1, 2, "slateMenuMiddleRight");
		
		flexTableFullBasketSlate.setWidget(1, 1, sp);
		
		add(flexTableFullBasketSlate);
	}
}
